home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 41
/
Aminet 41 (2001)(Schatztruhe)[!][Feb 2001].iso
/
Aminet
/
gfx
/
show
/
h8ilbm.lha
/
h8ilbm
/
src
/
render.asm
< prev
next >
Wrap
Assembly Source File
|
2000-12-16
|
3KB
|
168 lines
;*****************************************************************************
;
; h8ilbm - HiQuality-HAM8 IFF-24bit image viewer
; Copyright (C) 2000 Michael Henke
;
; This program is free software; you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation; either version 2 of the License, or
; (at your option) any later version.
;
; This program is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
; GNU General Public License for more details.
;
; You should have received a copy of the GNU General Public License
; along with this program; if not, write to the Free Software
; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
;
;*****************************************************************************
XDEF _render_h8row
section whatever,code
;** render_h8row **
;
;parameters:
; a0 UBYTE *rowbuf,
; d0 UWORD iw16,
; a1 struct BitMap *bmap,
; d1 UWORD row
RENDER MACRO
add.w d3,d3 ;1
addx.l d0,d0
add.w d4,d4
addx.l d0,d0
add.w d5,d5
addx.l d0,d0
add.l d0,d0
add.w d3,d3 ;2
addx.l d0,d0
add.w d4,d4
addx.l d0,d0
add.w d5,d5
addx.l d0,d0
add.l d0,d0
add.w d3,d3 ;3
addx.l d0,d0
add.w d4,d4
addx.l d0,d0
add.w d5,d5
addx.l d0,d0
add.l d0,d0
add.w d3,d3 ;4
addx.l d0,d0
add.w d4,d4
addx.l d0,d0
add.w d5,d5
addx.l d0,d0
add.l d0,d0
add.w d3,d3 ;5
addx.l d0,d0
add.w d4,d4
addx.l d0,d0
add.w d5,d5
addx.l d0,d0
add.l d0,d0
add.w d3,d3 ;6
addx.l d0,d0
add.w d4,d4
addx.l d0,d0
add.w d5,d5
addx.l d0,d0
add.l d0,d0
add.w d3,d3 ;7
addx.l d0,d0
add.w d4,d4
addx.l d0,d0
add.w d5,d5
addx.l d0,d0
add.l d0,d0
add.w d3,d3 ;8
addx.l d0,d0
add.w d4,d4
addx.l d0,d0
add.w d5,d5
addx.l d0,d0
move.l d0,d2 ;correct blue2
and.l d1,d2
add.l d0,d0
or.l d2,d0
ENDM
_render_h8row
movem.l d0-d7/a0-a6,-(a7)
move.w (a1),d7 ;bmap.BytesPerRow
add.w d7,d7 ;screen: 2 pixels per byte
cmp.w d0,d7
bmi.b min_bpr
move.w d0,d7
min_bpr lsr.w #4,d7
subq.w #1,d7
move.w d7,horiz_counter
lsr.w #3,d0
move.w d0,image_bpr+2
move.w (a1),d0 ;bmap.BytesPerRow
mulu d0,d1
move.l d1,bitplane_offset
moveq #6-1,d6 ;bitplane loop counter
lea 8(a1),a6 ;&bmap.Planes[0]
move.l #$11111111,d1
move.l image_bpr(pc),d2
bitplane_loop
move.l (a6)+,a2 ;bmap.Planes[i]
add.l bitplane_offset(pc),a2
move.l a0,a3 ;&red[i]
move.l d2,d3
add.l d2,d2
add.l d3,d2
lea (a3,d2.l*2),a4 ;&green[i]
lea (a4,d2.l*2),a5 ;&blue[i]
move.w (a3)+,d3
move.w (a4)+,d4
move.w (a5)+,d5
RENDER
move.l d0,(a2)+
RENDER
subq.w #1,d7
bmi horiz_end
horiz_loop
move.w (a3)+,d3
move.w (a4)+,d4
move.w (a5)+,d5
move.l d0,(a2)+
RENDER
move.l d0,(a2)+
RENDER
dbf d7,horiz_loop
horiz_end
move.l d0,(a2)+
move.w horiz_counter(pc),d7
move.l image_bpr(pc),d2
add.l d2,a0
dbf d6,bitplane_loop
movem.l (a7)+,d0-d7/a0-a6
rts
horiz_counter dc.w 0
image_bpr dc.l 0
bitplane_offset dc.l 0
END